<?php /*a:1:{s:69:"D:\ruanjian\phpStudy\WWW\blog\application\admin\view\login\login.html";i:1545109014;}*/ ?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title>博客后台登录</title>
    <link rel="stylesheet" href="<?php echo asset('admin/vendors/bootstrap/css/bootstrap.css'); ?>">
    <link rel="stylesheet" href="<?php echo asset('admin/css/admin.css'); ?>">
</head>
<body>
<div class="login">
<form id="login" class="login-wrap" action="" method="post">
    <img class="avatar" src="<?php echo asset('admin/img/default.png'); ?>">
    <div class="form-group">
        <label for="text" class="sr-only">用户名</label>
        <input  name="username" type="text" class="form-control" placeholder="用户名" autofocus>
    </div>
    <div class="form-group">
        <label for="password" class="sr-only">密码</label>
        <input id="password" name="password" type="password" class="form-control" placeholder="密码">
    </div>
    <input type="submit" class="btn btn-primary btn-block" value="&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;">
</form>
</div>
<script src="<?php echo asset('admin/vendors/jquery/jquery.js'); ?>"></script>
<script src="<?php echo asset('admin/layer/2.4/layer.js'); ?>"></script>
<script>
    $(function(){
        $('#login').submit(function(evt){
            evt.preventDefault();
            //获取form表单提供的数据
            var shuju =$(this).serialize();
            $.ajax({
                url:"admin/login/index",
                data:shuju,
                type:'post',
                dataType:'json',
                success:function(msg){
                    if(msg=='1'){
                        layer.alert('登录成功',{icon:6},function(){
                            location.href='admin/index/index';
                        })
                    }else{
                        layer.alert(msg,{icon:5});
                    }
                }
            })
        })
    })
</script>
</html>
